package my.mark.mybaibaoxiang.eventDemo.tests;

import my.mark.mybaibaoxiang.eventDemo.custom.EventKit;
import my.mark.mybaibaoxiang.eventDemo.custom.RegistEvent;
import my.mark.mybaibaoxiang.eventDemo.spring.WarnRuleJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author twotiger-wxm.
 * @date 2019-8-26.
 */
@RestController
@RequestMapping("/myTest/")
public class TestController {

    @Autowired
    WarnRuleJob warnRuleJob;

    @RequestMapping("testEvent")
    public void testEvent(){
        //调用spring的事件发布测试
        warnRuleJob.myFunction();
        //调用自定义的事件发布测试（老虎的）
        // 注册事件
        EventKit.postEvent(new RegistEvent(new TestDomain("张三","17","男")));
    }
}
